package config

type Database struct {
	DbType     string      `mapstructure:"db_type" json:"db_type" yaml:"db_type"`
	MySQL      *MySQL      `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	PostgreSQL *PostgreSQL `mapstructure:"postgre_sql" json:"postgre_sql" yaml:"postgre_sql"`
}

// MySQL 数据库配置
type MySQL struct {
	DriverName                    string `mapstructure:"driver_name" json:"driver_name" yaml:"driver_name"`
	ServerVersion                 string `mapstructure:"server_version" json:"server_version" yaml:"server_version"`
	DSN                           string `mapstructure:"dsn" json:"dsn" yaml:"dsn"`
	SkipInitializeWithVersion     bool   `mapstructure:"skip_initialize_with_version" json:"skip_initialize_with_version" yaml:"skip_initialize_with_version"`
	DefaultStringSize             uint   `mapstructure:"default_string_size" json:"default_string_size" yaml:"default_string_size"`
	DisableWithReturning          bool   `mapstructure:"disable_with_returning" json:"disable_with_returning" yaml:"disable_with_returning"`
	DisableDatetimePrecision      bool   `mapstructure:"disable_datetime_precision" json:"disable_datetime_precision" yaml:"disable_datetime_precision"`
	DontSupportRenameIndex        bool   `mapstructure:"dont_support_rename_index" json:"dont_support_rename_index" yaml:"dont_support_rename_index"`
	DontSupportRenameColumn       bool   `mapstructure:"dont_support_rename_column" json:"dont_support_rename_column" yaml:"dont_support_rename_column"`
	DontSupportForShareClause     bool   `mapstructure:"dont_support_for_share_clause" json:"dont_support_for_share_clause" yaml:"dont_support_for_share_clause"`
	DontSupportNullAsDefaultValue bool   `mapstructure:"dont_support_null_as_default_value" json:"dont_support_null_as_default_value" yaml:"dont_support_null_as_default_value"`
	DontSupportRenameColumnUnique bool   `mapstructure:"dont_support_rename_column_unique" json:"dont_support_rename_column_unique" yaml:"dont_support_rename_column_unique"`
}

// PostgreSQL 数据库配置
type PostgreSQL struct {
	DriverName           string `mapstructure:"driver_name" json:"driver_name" yaml:"driver_name"`
	DSN                  string `mapstructure:"dsn" json:"dsn" yaml:"dsn"`
	PreferSimpleProtocol bool   `mapstructure:"prefer_simple_protocol" json:"prefer_simple_protocol" yaml:"prefer_simple_protocol"`
	WithoutReturning     bool   `mapstructure:"without_returning" json:"without_returning" yaml:"without_returning"`
}
